import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Home',
    component: Home
  },
  {
    path: '/nuclein',
    name: 'Nuclien',
    component: () => import('@/views/Nuclein/index.vue')
  },
  {
    path: '/risk',
    name: 'Risk',
    component: () => import('@/views/RiskArea/index.vue')
  },
  {
    path: '/prevention',
    name: 'Prevention',
    component: () => import('@/views/Prevention/index.vue')
  },
  {
    path: '/city/:cityName',
    name: 'City',
    component: () => import('@/views/City/index.vue'),
    props: true
  },
  {
    path: '/travel',
    name: 'Travel',
    component: () => import('@/views/Travel/index.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
